//package cn.genmer.test.security.config;
//
//import org.apache.http.HttpHost;
//import org.apache.http.auth.AuthScope;
//import org.apache.http.auth.UsernamePasswordCredentials;
//import org.apache.http.client.CredentialsProvider;
//import org.apache.http.impl.client.BasicCredentialsProvider;
//import org.elasticsearch.client.RestClient;
//import org.elasticsearch.client.RestHighLevelClient;
//
///**
// *
// * @Description: 获取Java High Level REST Client客户端
// * @author lgs
// * @date 2018年6月23日
// *
// */
//public class InitDemo {
//
//    public static RestHighLevelClient getClient() {
//        CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
//        credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic","elastic"));
//        RestHighLevelClient client = new RestHighLevelClient(
//                RestClient.builder(new HttpHost("www.reentrantlock.cn", 9200, "http"),
//                        new HttpHost("www.reentrantlock.cn", 9201, "http"))
//                .setHttpClientConfigCallback(f -> f.setDefaultCredentialsProvider(credentialsProvider))
//        );
//        return client;
//    }
//}